package example.blobapi;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.blobstore.BlobstoreService;
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;

public class UploadUrl extends HttpServlet {

	private BlobstoreService blobstoreService = BlobstoreServiceFactory
	.getBlobstoreService();
	public void doPost(HttpServletRequest req, HttpServletResponse res)
			throws IOException {
		String uploadUrl = blobstoreService.createUploadUrl("/upload");
		res.addHeader("uploadUrl", uploadUrl);
	}
}
